<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
		<script src="../js/axios.js"></script>
	</head>
	<body>
		<div id="a">
			<button @click="show()">点我</button>
			<h3>{{msg}}</h3>
		</div>
		<script type="text/javascript">
			new Vue({
				el:"#a",
				data(){
					return{
						msg:""
					}
				},
				methods:{
					show(){
						let url1 = "http://localhost:8080/axios/saveUser";
						let user1 = {id:100,name:"猫子",age:16,sex:"雌的"}
						axios.post(url1,user1)
						.then(promise => {
							console.log(promise.data)
						})
						
						
						let url2 = "http://localhost:8080/axios/updateUser";
						let user2 = {id:100,name:"张三",age:14,sex:"女"};
						axios.put(url2,user2)
						.then(function(promise){
							console.log(promise.data)
						})
						
					
					}
				}
			})
			
		</script>
		
	</body>
</html>
